<?php
include ('chek.php');

$sid=$set_is['sid'];
if($input->get('set')=='add'){
    $title=$input->post('s_title');
    $jianjie=$input->post('s_jianjie');
    $pagenum=$input->post('s_pagenum');
    $sql="update setting set title='{$title}',intro='{$jianjie}',s_page='{$pagenum}' WHERE sid='{$sid}'";
    $is=$db->query($sql);
    if($is){
        header('location:blog.php');
    }else{
        die('执行失败！');
    }
}
?>
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8" />
    <title>系统管理</title>
    <?php include (PATH.'/headr.php') ?>
</head>
<body>
<?php include ('nac.inc.php'); ?>
<div class="container">
    <div class="row">
        <h2>管理员管理<small class="pull-right"><a class="btn btn-default" href="blog.php">返回</a></small></h2>
        <hr/>
        <form class="form-horizontal" action="setting.php?set=add" method="post">
            <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">标题</label>
                <div class="col-sm-6">
                    <input type="text" name="s_title" class="form-control" id="inputEmail3" placeholder="请输入标题" value="<?php echo $set_is['title'] ;?>" >
                </div>
            </div>
            <div class="form-group">
                <label for="inputPassword3" class="col-sm-2 control-label">网站简介</label>
                <div class="col-sm-6">
                    <input type="text" name="s_jianjie" class="form-control" id="inputPassword3" placeholder="请输入" value="<?php echo $set_is['intro'] ;?>">
                </div>
            </div>
            <div class="form-group">
                <label for="inputPassword3" class="col-sm-2 control-label">显示数</label>
                <div class="col-sm-6">
                    <input type="text" name="s_pagenum" class="form-control" id="inputPassword3" placeholder="请输入" value="<?php echo $set_is['s_page'] ;?>" >
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-6">
                    <button type="submit" class="btn btn-default">提交</button>
                </div>
            </div>
        </form>
    </div>
</div>
</body>
</html>